package com.muchfish.reactor.api;

import reactor.core.publisher.Flux;

public class ReactorCacheExample {
    public static void main(String[] args) {
        Flux<Integer> source = Flux.range(1, 3)
                .log() //日志
                .cache();

        source.subscribe(System.out::println); // 输出: 1, 2, 3
        source.subscribe(System.out::println); // 输出: 1, 2, 3 直接从缓存中取，日志中显示，未调用request、onNext等方法
    }
}
